package uplift.project;

import java.util.Timer;
import java.util.TimerTask;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class SplashActivity extends Activity {

private static final long DELAY = 3000; //in ms
	
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash);
		
		launchMain();
	}

	/**
	 * Causes the view to destroy itself after the activity is terminated. 
	 */
	@Override
	public void onStop() {
		super.onStop();
		this.finish();
	}
	
	/**
	 * Method to launch the main menu after a given amount of time.  The time
	 * delay can be set using the DELAY constant.  The value is in milliseconds.
	 */
	public void launchMain() {
		final Intent intent = new Intent(this, UpliftActivity.class);
		new Timer().schedule(new TimerTask(){
				@Override
				public void run() {
					startActivity(intent);
				}
		}, DELAY);
	}
}
